package com.team.recruitment_management_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.team.recruitment_management_system.mapper.ExpectMapper;
import com.team.recruitment_management_system.pojo.entity.Expect;
import com.team.recruitment_management_system.service.ExpectService;
import com.team.recruitment_management_system.util.result.Result;
import com.team.recruitment_management_system.util.result.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 86147
* @description 针对表【expect(求职期望表)】的数据库操作Service实现
* @createDate 2024-03-21 20:28:40
*/
@Service
public class ExpectServiceImpl extends ServiceImpl<ExpectMapper, Expect>
    implements ExpectService{
    @Autowired
    ExpectMapper expectMapper;

    public Result add(Expect expect){
        return expectMapper.insert(expect) == 0?Result.build("请重试", ResultCodeEnum.ILLEGAL_OPERATION):Result.ok(null,"添加成功");
    }


    public Result update( Expect expect){

        return expectMapper.updateById(expect) == 0?Result.build("请重试", ResultCodeEnum.ILLEGAL_OPERATION):Result.ok(null,"修改成功");
    }
}




